package com.lanju.entity;

import java.io.Serializable;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

import com.fasterxml.jackson.annotation.JsonIgnore;

@Entity
@Table(name="lj_area_community")
public class Community implements Serializable{



	private static final long serialVersionUID = 2367346290820717260L;
	/**
	 * 小区id
	 */
	private Integer community_id;
	/**
	 * 小区名称
	 */
	private String community_name;
	/**
	 * 城市名称
	 */
	private String city_name;
	
	/**
	 * 区域名称
	 */
	private String area_name;
	/**
	 * 小区简介
	 */
	private String community_desc;
	
	private Date create_time;
	
	private String creator;
	
	private String updator;
	
	private Date update_time;
	
	private Set<CommunityImg> communityimg=new HashSet<CommunityImg>();

	  @Id
	  @Column(name="community_id", unique=true, nullable=false)
	  @GeneratedValue(strategy=GenerationType.AUTO)
	public Integer getCommunity_id() {
		return community_id;
	}

	public void setCommunity_id(Integer community_id) {
		this.community_id = community_id;
	}
	
	@Column(name="community_name")
	public String getCommunity_name() {
		return community_name;
	}

	public void setCommunity_name(String community_name) {
		this.community_name = community_name;
	}
	@Column(name="area_name")
	public String getArea_name() {
		return area_name;
	}

	public void setArea_name(String area_name) {
		this.area_name = area_name;
	}
	@Column(name="community_desc")
	public String getCommunity_desc() {
		return community_desc;
	}

	public void setCommunity_desc(String community_desc) {
		this.community_desc = community_desc;
	}
	@Column(name="create_time")
	public Date getCreate_time() {
		return create_time;
	}

	public void setCreate_time(Date create_time) {
		this.create_time = create_time;
	}
	@Column(name="creator")
	public String getCreator() {
		return creator;
	}

	public void setCreator(String creator) {
		this.creator = creator;
	}
	@Column(name="updator")
	public String getUpdator() {
		return updator;
	}

	public void setUpdator(String updator) {
		this.updator = updator;
	}
	@Column(name="update_time")
	public Date getUpdate_time() {
		return update_time;
	}

	public void setUpdate_time(Date update_time) {
		this.update_time = update_time;
	}
	@JsonIgnore
    @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER, mappedBy = "community")
	public Set<CommunityImg> getCommunityimg() {
		return communityimg;
	}

	public void setCommunityimg(Set<CommunityImg> communityimg) {
		this.communityimg = communityimg;
	}
	@Column(name="city_name")
	public String getCity_name() {
		return city_name;
	}

	public void setCity_name(String city_name) {
		this.city_name = city_name;
	}

}
